﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys0a80
    {
		private string _fnkey;
		private string _fname;
		private string _isprivate;
		private string _fncontent;
		private string _remark;
		private string _muser;
        private DateTime? _mdate;
		
        /// <summary>
        /// 函数键名
        /// </summary>
		public string Fnkey
		{
			get { return _fnkey;	 }
			set { _fnkey=value;	}
		}
        /// <summary>
        /// 函数名称
        /// </summary>
		public string Fname
		{
			get { return _fname;	 }
			set { _fname=value;	}
		}
        /// <summary>
        /// 是否私有
        /// </summary>
		public string Isprivate
		{
			get { return _isprivate;	 }
			set { _isprivate=value;	}
		}
        /// <summary>
        /// 函数内容
        /// </summary>
		public string Fncontent
		{
			get { return _fncontent;	 }
			set { _fncontent=value;	}
		}
        /// <summary>
        /// 简要说明
        /// </summary>
		public string Remark
		{
			get { return _remark;	 }
			set { _remark=value;	}
		}
        /// <summary>
        /// 维护者
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 维护时间
        /// </summary>
		public DateTime? Mdate
		{
			get { return _mdate;	 }
			set { _mdate=value;	}
		}
		
		public static List<Sys0a80> GetSys0a80ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys0a80> list = new List<Sys0a80>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys0a80 model = GetSys0a80ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys0a80 GetSys0a80ByDataRow(DataRow dr)
		{
			Sys0a80 model = new Sys0a80(); //实例化Sys0a80
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("fnkey")&&!(dr["fnkey"] is System.DBNull))  
				model.Fnkey = ( string)dr["fnkey"];
			if (dcc.Contains("fname")&&!(dr["fname"] is System.DBNull))  
				model.Fname = ( string)dr["fname"];
			if (dcc.Contains("isprivate")&&!(dr["isprivate"] is System.DBNull))  
				model.Isprivate = ( string)dr["isprivate"];
			if (dcc.Contains("fncontent")&&!(dr["fncontent"] is System.DBNull))  
				model.Fncontent = ( string)dr["fncontent"];
			if (dcc.Contains("remark")&&!(dr["remark"] is System.DBNull))  
				model.Remark = ( string)dr["remark"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("mdate")&&!(dr["mdate"] is System.DBNull))  
				model.Mdate = ( DateTime)dr["mdate"];
			
			return model;
		}
    }
}
